package interview.juide;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author tu zy
 * @Date 2020/11/18 15:27
 * @Version 1.0
 */
public class Case_1 {
    public static void main(String[] args) {
        Integer[] myArray = {1, 2, 3};
        Arrays.stream(myArray).collect(Collectors.toList());

        //基本类型也可以实现
        int[] myArray2 = {1, 2, 3};
        Arrays.stream(myArray2).boxed().collect(Collectors.toList());

        String[] s = new String[]{
                "dog", "lazy", "a", "over", "jumps", "fox", "brown", "quick", "A"
        };
        List<String> list = Arrays.asList(s);
        Collections.reverse(list);
        s = list.toArray(new String[0]);//没有指定类型的话会报错
        System.out.println(s);
    }
}
